<?php
  include("include/config.inc.php");
  
  if(isset($_REQUEST['waiter']))
  {
    $waiterVar = $_REQUEST['waiter'] ;
  }
  else
  {
    $waiterVar = 0 ;
  }
  
  if(isset($_REQUEST['table']))
  {
    $tableVar = $_REQUEST['table'] ;
  }
  else
  {
    $tableVar = 0 ;
  }
  $tablePartVar=$_REQUEST['tablePart'];  

  $k = 0;
  $updateItem = array();
  $selectItemQuantity="SELECT ordereditems.itemId,ordereditems.quantity
                         FROM ordereditems 
                        INNER JOIN ordermaster 
                        WHERE waiterId='".$_REQUEST['waiter']."' 
                          AND tableId='".$_REQUEST['table']."'
                          AND orderstatus = 'L'";
  $selectItemQuantityRes=mysql_query($selectItemQuantity);
  while($itemRows=mysql_fetch_array($selectItemQuantityRes))
  {
    $updateItem['itemId'][$k]   = $itemRows['itemId'];
    $updateItem['quantity'][$k] = $itemRows['quantity'];
    $k++;
  }
  

include("./bottom.php");
$smarty->assign('tableVar', $tableVar);
$smarty->assign('waiterVar', $waiterVar);
$smarty->assign('tablePartVar', $tablePartVar);
$smarty->display('itemMenu.tpl');
?>